// 导入axios实例
import request from '@/utils/request'

// 封装部门列表接口函数
export function getDepaetments() {
  return request({
    url: '/company/department'
  })
}

// 封装添加部门列表接口函数
export function addDepaetments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 封装获取部门详情数据接口函数
export function getdataDepaetments(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 封装修改部门列表接口函数
export function updataDepaetments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 封装删除改部门列表接口函数
export function delDepaetments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
